<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>默笙科技后台管理系统 - 文章管理</title>
    <meta name="keywords" content="默笙科技后台管理系统,强大的功能程序,默笙科技" />
    <meta name="description" content="默笙科技后台管理系统" />
    <link rel="shortcut icon" href="favicon.ico"> <link href="/Public/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/admin/css/font-awesome.min.css" rel="stylesheet">

    <!-- Data Tables -->
    <link href="/Public/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="/Public/admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/admin/css/style.min.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>API应用管理</h2>
            <ol class="breadcrumb">

                <li>
                    <strong>API应用管理</strong>
                </li>
            </ol>
        </div>
        <div class="col-sm-8">
            <div class="title-action">
                <a href="{:U('tool/apiadd')}" class="btn btn-primary">添加API</a>
            </div>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">

        <div class="row">

            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>API应用管理 <small>在此处编辑</small></h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="#">选项1</a>
                                </li>
                                <li><a href="#">选项2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">

                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                                <tr>
                                   <th></th>
                                    <th>网站LOGo</th>
                                    <th>网站标题</th>
                                    <th>URL</th>
                                    <th>作者</th>
                                    <th>排序</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <volist name="api" id="api">
                                <tr class="gradeX">
                                    <td>
                                    <input type="checkbox"  class="i-checks" name="input[]">
                                    </td>
                                    <td>{$api.logo}</td>
                                    <td>{$api.title}</td>
                                    <td>{$api.url}</td>
                                    <td class="cssenter">{$api.author}</td>
                                    <td class="center">{$api.yd}</td>
                                    <td><a href="apiedit.html?id={$api.id}"><i class="fa fa-pencil">编辑</i></a>&nbsp;&nbsp;&nbsp;
                                                <a onClick="ty_del(this,'{$api.id}')" href="javascript:;"><i class="fa fa-times">删除</i></a>
                                    </td>
                                 </tr>
                                </volist>
                                
                            </tbody>
                            <tfoot>
                                <tr>
                                    <th></th>
                                    <th>网站LOGo</th>
                                    <th>网站标题</th>
                                    <th>URL</th>
                                    <th>作者</th>
                                    <th>排序</th>
                                    <th>操作</th>
                                </tr>
                            </tfoot>
                        </table>

                    </div>
                </div>
            </div>
        </div>
        
    </div>
    <script src="/Public/admin/js/jquery.min.js"></script>
    <script src="/Public/admin/js/layer/layer.js"></script>
    <script src="/Public/admin/js/bootstrap.min.js"></script>
    <script src="/Public/admin/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="/Public/admin/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="/Public/admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="/Public/admin/js/content.min.js"></script>
    <script>
        $(document).ready(function(){$(".dataTables-example").dataTable();var oTable=$("#editable").dataTable();oTable.$("td").editable("../example_ajax.php",{"callback":function(sValue,y){var aPos=oTable.fnGetPosition(this);oTable.fnUpdate(sValue,aPos[0],aPos[1])},"submitdata":function(value,settings){return{"row_id":this.parentNode.getAttribute("id"),"column":oTable.fnGetPosition(this)[2]}},"width":"90%","height":"100%"})});function fnClickAddRow(){$("#editable").dataTable().fnAddData(["Custom row","New row","New row","New row","New row"])};
    </script>
    <script type="text/javascript">
        
 function ty_del(obj,id){
        var id = id;

        layer.confirm('确认要删除吗？',function(index){

        $.ajax({
            type: 'POST',
            url: '{:U('tool/apidel')}',
            dataType: 'html',
            data:{id:id},
            success: function(data){
                
                layer.msg('已删除!',{icon:1,time:1000});
                window.location.reload();
            },
            error:function(data) {
                console.log(data.msg);
            },
        });     
    });
}
    </script>

</body>

</html>
